package com.sofwin.yyb.service.impl;

import com.sofwin.yyb.dao.AppointmentDao;
import com.sofwin.yyb.dto.AppointmentDto;
import com.sofwin.yyb.entity.Appointment;
import com.sofwin.yyb.service.AppointmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service("orderService")
public class AppointmentServiceImpl implements AppointmentService {

    @Autowired
    AppointmentDao appointmentDao;

    @Override
    public List<Appointment> findUListByStatus(Map<String,Object> map) {
        return appointmentDao.selectUListByStatus(map);
    }

    @Override
    public List<Appointment> findMListByStatus(Map<String, Object> map) {
        return appointmentDao.selectMListByStatus(map);
    }

    /**
     * 修改用户订单状态
     * @param map
     */
    @Override
    public void updateUStatus(Map<String, Object> map) {
        appointmentDao.updateOrderUStatus(map);
    }

    /**
     * 修改商家订单状态
     * @param map
     */
    @Override
    public void updateMStatus(Map<String, Object> map) {
        appointmentDao.updateOrderMStatus(map);
    }

    /**
     * 查询所有预约信息
     * @param map
     * @return
     */
    @Override
    public List<AppointmentDto> findAllAppointment(Map<String, Object> map) {
        return appointmentDao.selectAllAppointment(map);
    }

    /**
     * 查询预约信息数量
     * @param search 模糊查询关键字
     * @return
     */
    @Override
    public Integer appointmentCount(String search) {
        return appointmentDao.selectAppointmentCount(search);
    }

}
